package com.wlstock.funi.Trader;

import com.wlstock.funi.utils.TimeUtils;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by admin on 16/9/20.
 */

public class ConfigUtils {

    public static final String KEY_START_TIME = "start";
    public static final String KEY_END_TIME = "end";
    public static final String KEY_MinIndex  = "MinIndex";
    public static final String KEY_MaxPosition = "MaxPosition";
    public static final String KEY_MinMoney = "MinMoney";

    public static HashMap<String,String> trigTime(String startHour,String endHour){
        HashMap<String, String> map = new HashMap<>();
        map.put(KEY_START_TIME,startHour);
        map.put(KEY_END_TIME,endHour);
        return map;
    }

    public static boolean isTimeInConfigRange(Map<String,String > param){
        String start =  param.get(KEY_START_TIME);
        String end   =  param.get(KEY_END_TIME);
        return TimeUtils.isHourInRange(start,end,new Date());
    }

}
